//
//  SentryModule.m
//  AFNetworking
//
//  Created by 胡锦涛 on 2021/1/6.
//

#import "SentryModule.h"
#import "HKLibBaseHeader.h"
#import <Sentry/Sentry.h>


@implementation SentryModule
+ (void)load {
    BFRegister(SentryLibService);
}

#pragma mark - BifrostModuleProtocol
+ (instancetype)sharedInstance {
    static SentryModule *instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[self alloc] init];
    });
    return instance;
}

- (void)setup {
    
}
//TODO:通过此方法设置Module执行的优先级
+ (NSUInteger)priority {
    return BifrostModuleDefaultPriority; //higher priority than other modules
}

+ (BOOL)setupModuleSynchronously {
    return YES;
}

#pragma mark - UIApplicationDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // 我的Sentry地址
    //https://sentry.io/organizations/stevenhusir/issues/?project=5522877&query=is%3Aunresolved
    // Sentry 初始化相关
    [SentrySDK startWithConfigureOptions:^(SentryOptions * _Nonnull options) {
        options.dsn = @"https://de309a1157a143f68d8e6013181e0ee6@o479030.ingest.sentry.io/5522877";
        options.debug = YES;
    }];

    return YES;
}
@end
